package cu.tedu.egmvc1.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class UserController {
    @RequestMapping("/v1/users/insert")
    @ResponseBody
    public String insert(String username, String password,String nickname){
        return "添加用户成功："+"用户名："+username+"密码："+password+"昵称："+nickname;
    }


    @RequestMapping("/v1/users/userList")
    @ResponseBody
    public String select(){
        return "查询用户列表成功";
    }

    @RequestMapping("/v1/users/delete")
    @ResponseBody
    public String delete(Integer id){
        return "删除成功，用户id为："+id;
    }

    @RequestMapping("/v1/users/update")
    @ResponseBody
    public String update(Integer id,String username, String password,String nickname){
        return "更新用户成功："+"用户id:"+id+"用户名："+username+"密码："+password+"昵称："+nickname;
    }
}
